class Hash
  def recursive_update(other)
    recursive_updater = lambda{|k,a,b|
      case a
      when Hash
        a.update(b, &recursive_updater)
        a
      when Array
        b.each {|e| a << e}
        a
      else
        b
      end
    }

    self.update(other, &recursive_updater)
  end
end
